<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

    <div id="bpp">
        <h1>{{msg}}</h1>
        //表达式和对象
        <p>我叫{{obj.name}}今年{{obj.age+1}}岁</p>
        //函数
        <p>{{fn()}}</p>
        //方法
        <p>{{msg}}是由{{msg.split(' ')}}两个单词组成</p>
    </div>
    <script>
        Vue.createApp({
            setup() {
                const msg = "hello Word";
                const obj = {
                    name: 'zhangsan',
                    age: 10
                }
                const fn = function () {
                    return 666
                }
                return { msg, obj, fn };
            }
        }).mount("#bpp");
    </script>

</body>

</html>